package com.sr.demo.security.config;


import com.sr.demo.security.user.NuoUser;
import org.springframework.security.core.context.SecurityContextHolder;

/**
 * @author liushuai
 * @date 2020/8/23 14:55
 */
public class CurrentUser {



    public static NuoUser getCurrentUser(){
        return (NuoUser)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
    }
}
